package com.fuchenyang.provider.controller;

import com.fuchenyang.common.ResultTool;
import com.fuchenyang.common.util.JsonResult;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/provider")
public class ProviderController {

    @Value("${server.port}")
    private Integer port;

    @GetMapping("/a")
    public JsonResult a() {
        return ResultTool.success("This is ProviderController`a method!port:" + port);
    }

    @GetMapping("/b/{name}")
    public JsonResult b(@PathVariable("name") String name) {
        return ResultTool.success("This is ProviderController`b method!name:" + name + ",port:" + port);
    }
}